如何快速新建代码片段创建vue2模板 您所在的位置:网站首页 vue 创建模板 如何快速新建代码片段创建vue2模板

如何快速新建代码片段创建vue2模板

#如何快速新建代码片段创建vue2模板| 来源: 网络整理| 查看: 265

快速创建vue2代码片段

首先安装vscode,可以去官网或者电脑应用商店自行下载 ( 例如联想电脑:联想应用商店 ) [vscode官网]: code.visualstudio.com/Download 选择对应系统的版本,进行安装

Code.png

1、打开vscode编辑器 找到左下角设置

set.png

2、点开设置-->用户代码片段

snippet.png

3、点开设置-->用户代码片段-->选择新建代码片段

new.png

4、选择新代码片段,输入下面的代码再进行保存,就可以新建vue页面输入"vue",按下回车或者tab键进行创建模板

提示:prefix:是选择创建命令,description:是方便识别此代码片段的作用

{ // Place your snippets for vue here. Each snippet is defined under a snippet name and has a prefix, body and // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the // same ids are connected. // Example: // "Print to console": { //  "prefix": "log", //  "body": [ //  "console.log('$1');", //      "$2" //  ], //  "description": "Log output to console" // } "Print to console": { "prefix": "vue", "body": [ "", " \n", " ", "\n", "", "export default {", " props: {\n", " },", " components: {\n", " },", " data() {", " return {\n", " };", " },", " computed: {\n", " },", " watch: {\n", " },", " created() {\n", " },", " mounted() {\n", " },", " methods: {\n", " },", "};", "\n", "\n", "\n", ], "description": "Create vue template" } } 这样就能快速创建vue2模板,省去了一些写代码的时间


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有